Skip to content

style(black): apply new format style from black#49

Merged
wbarnha merged 1 commit into
faust-streaming:masterfrom
manawasp:style/apply-new-black-format
Feb 22, 2024
Merged

style(black): apply new format style from black#49
wbarnha merged 1 commit into
faust-streaming:masterfrom
manawasp:style/apply-new-black-format

Conversation

@manawasp

Copy link
Copy Markdown

Fix CI issue seen in the PR #48

(I preferred opened another PR to fix this)

@manawasp

Copy link
Copy Markdown
Author

Thanks for the CI noticed some issue :

FAILED t/unit/test_services.py::test_Service::test_wait_first__propagates_exceptions - RuntimeError: Event loop is closed

I will take a look later, I believe there is a not pin dependency issue maybe related to pytest-asyncio if used.

@wbarnha wbarnha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've re-read this MR several times and I'm still baffled as to why this test is failing:

 =================================== FAILURES ===================================
_____________ test_Service.test_wait_first__propagates_exceptions ______________

self = <t.unit.test_services.test_Service object at 0x7f2d2cd492d0>

    @pytest.mark.asyncio
    async def test_wait_first__propagates_exceptions(self, *, service):
        exc = KeyError("foo")
        m1 = Mock()
        m1.done.return_value = True
        m1.exception.return_value = exc
        m1.result.side_effect = exc
        with patch("asyncio.wait", AsyncMock()) as wait:
            wait.return_value = ((m1,), ())
            with pytest.raises(KeyError):
>               await service.wait_first(asyncio.sleep(5), timeout=5)

t/unit/test_services.py:629: 

I'll need to look around more. Sorry that such a simple change turned into this much of an inconvenience. 🤦‍♂️

@manawasp

manawasp commented Feb 22, 2024

Copy link
Copy Markdown
Author

No pb !

I strongly believe fixing pytest-asyncio in test to 0.21.1 will fix the issue related to pytest-dev/pytest-asyncio#706

EDIT:

I ran tests locally and got issue with the test test_secs_for_next_with_tz due to missing timezone "US/Pacific" but I'm not sure if the timezone source is Python internal or related to computer setup.

@manawasp
manawasp force-pushed the style/apply-new-black-format branch from 4c3f14b to 19eae80 Compare February 22, 2024 18:17
@manawasp
manawasp requested a review from wbarnha February 22, 2024 18:19

@wbarnha wbarnha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytest-asyncio is having some issues right now, so pinning is the right move for now. LGTM!

@wbarnha
wbarnha merged commit 9bedd87 into faust-streaming:master Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants